import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

//自定义组件
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // MaterialApp是根组件
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('First Web'),
        ),
        body: Column(
          children: [
            ElevatedButton(
              onPressed: () {},
              child: Text("ElevatedButton"),
              style: ButtonStyle(
                  textStyle: MaterialStateProperty.all(TextStyle(fontSize: 16)),
                  foregroundColor: MaterialStateProperty.all(Color(0xff31c27c)),
                  side: MaterialStateProperty.all(
                      BorderSide(width: 1, color: Colors.amberAccent)),
                  shadowColor: MaterialStateProperty.all(Colors.red),
                  elevation: MaterialStateProperty.all(10),
                  backgroundColor:
                      MaterialStateProperty.all(Color(0xffEDFCF5))),
            ),
            TextButton(
              onPressed: () {},
              child: Text("TextButton"),
            ),
            OutlinedButton(onPressed: () {}, child: Text("OutlinedButton")),
            ButtonBar(
              children: [
                TextButton(
                  onPressed: () {},
                  child: Text("ButtonBar1"),
                ),
                TextButton(
                  onPressed: () {},
                  child: Text("ButtonBar2"),
                )
              ],
            ),
          ],
        ),
      ),
      theme: ThemeData(primaryColor: Colors.blue),
    );
  }
}
